package com.isorf.controller;


import com.isorf.pojo.student;
import com.isorf.service.StudentService;
import com.isorf.util.responseresult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Api(tags ="学生接口")
@RestController
@RequestMapping("/student")
public class studentcontroller {
    //调用service层
@Autowired
    private StudentService studentservice;
@ApiOperation("获得全部学生信息")
@RequestMapping("/getallstudents")
public responseresult<List<student>> getallstudents() {
    List<student> students = studentservice.getallstudents();
    if (students == null) {
        return responseresult.failure(508, "没有学生信息");
    }else {
        return responseresult.success(200, "查询成功", students);

    }
}
}